//
//  JAStatusToolBar.swift
//  JAWeiBo
//
//  Created by Arvin on 17/4/6.
//  Copyright © 2017年 Arvin. All rights reserved.
//

import UIKit

class JAStatusToolBar: UIView {

    ///转发按钮
    lazy var retweetButton: UIButton = UIButton(title: "30", titleColor: UIColor.lightGray, fontSize: 11, image: "timeline_icon_retweet")
    
    ///评论按钮
    lazy var commentButton: UIButton = UIButton(title: "30", titleColor: UIColor.lightGray, fontSize: 11, image: "timeline_icon_comment")
    
    ///点赞按钮
     lazy var prizeButton: UIButton = UIButton(title: "30", titleColor: UIColor.lightGray, fontSize: 11, image: "timeline_icon_unlike")
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}

// MARK: - 设置UI
extension JAStatusToolBar {
    fileprivate func setupUI () {
        
        //设置背景颜色
        self.backgroundColor = UIColor(patternImage: UIImage(named: "timeline_card_bottom_background")!)
        
        //添加子控件
        addSubview(retweetButton)
        addSubview(commentButton)
        addSubview(prizeButton)
        
        //添加约束
        retweetButton.snp.makeConstraints { (make) in
            make.top.left.bottom.equalTo(self)
        }
        
        commentButton.snp.makeConstraints { (make) in
            make.top.bottom.equalTo(self)
            make.left.equalTo(retweetButton.snp.right)
            make.width.equalTo(retweetButton)
        }

        prizeButton.snp.makeConstraints { (make) in
            make.left.equalTo(commentButton.snp.right)
            make.top.right.bottom.equalTo(self)
            make.width.equalTo(commentButton)
        }

    }
}
